/*
 * Copyright (c) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __LINUX_USB_VIDEO_H
#define __LINUX_USB_VIDEO_H

#include <stdint.h>
#include <linux/types.h>

#define UVC_VC_SETCUR_COMPLETE 0xff

/*
 * Video Class-specific Request Codes, UVC spec. 1.5, section A.8
 */
#define UVC_RC_SETCUR            0x01
#define UVC_RC_SETCUR_ALL        0x11
#define UVC_RC_GETCUR            0x81
#define UVC_RC_GETMIN            0x82
#define UVC_RC_GETMAX            0x83
#define UVC_RC_GETRES            0x84
#define UVC_RC_GETLEN            0x85
#define UVC_RC_GETINFO           0x86
#define UVC_RC_GETDEF            0x87
#define UVC_RC_GETCUR_ALL        0x91
#define UVC_RC_GETMIN_ALL        0x92
#define UVC_RC_GETMAX_ALL        0x93
#define UVC_RC_GETRES_ALL        0x94
#define UVC_RC_GETDEF_ALL        0x95

typedef struct _uvcx_base_ctrl_t {
    uint16_t selector;
    uint16_t index;
} __attribute__ ((__packed__)) uvcx_base_ctrl_t;

typedef struct uvcx_camera_stream_t {
    uint16_t format;
    uint16_t resolution;
} __attribute__ ((__packed__)) uvcx_camera_stream_t;

#endif /* __LINUX_USB_VIDEO_H */
